package org.chen.bas.monitoring;

import org.chen.auth.service.IPermissionScanService;
import org.chen.auth.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener //此注解是把这个类交给spring管理
public class Monitoring implements ServletContextListener {
    @Autowired
    private IPermissionScanService scanService;

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("项目启动===========");
        System.out.println("项目启动成功=========");
        scanService.scan();
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
